package com.bruce.starts.demo.xiaomage.genericity;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
import java.util.function.Consumer;

/**
 * @author luotuan
 * @Description
 * @create 2021-05-26 13:24
 **/
public class GenericityDemo {
    public static void main(String[] args) {
        foreach(Arrays.asList("1","2","3"),System.out::println);

    }
    public static void print(Serializable e){
        System.out.println(e);
    }

    public static  <C extends Iterable<E>,E extends Serializable> void  foreach(C target, Consumer<E> consumer){
        for(E e : target){
            consumer.accept(e);
        }
    }
    public static void add(List<? extends Number> list,Number number){
    }
}
